import { Controller, Get } from '@nestjs/common';
import { DashboardService } from './dashboard.service';
import { createResponse } from '../common/response.interface';
import type { IResponse } from '../common/response.interface';

@Controller('dashboard')
export class DashboardController {
  constructor(private readonly dashboardService: DashboardService) {}

  @Get('health-score')
  async getHealthScore(): Promise<IResponse<number>> {
    const healthScore = await this.dashboardService.getHealthScore();
    return createResponse(healthScore);
  }

  @Get('kpi')
  async getKpiMetrics(): Promise<IResponse<any>> {
    const kpiMetrics = await this.dashboardService.getKpiMetrics();
    return createResponse(kpiMetrics);
  }

  @Get('heatmap')
  async getHeatmapData(): Promise<IResponse<any[]>> {
    const heatmapData = await this.dashboardService.getHeatmapData();
    return createResponse(heatmapData);
  }
}